package com.mercury.ec.module.air.controller.admin.order.vo.orderroute;

import com.mercury.ec.module.air.controller.admin.order.validator.AirOrderRouteSuperUpdateSequenceProvider;
import com.mercury.ec.module.air.validator.AirGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.group.GroupSequenceProvider;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@GroupSequenceProvider(value = AirOrderRouteSuperUpdateSequenceProvider.class)
@Schema(description = "管理后台 - 机票订单行程超级更新 Request VO")
public class AirOrderRouteSuperUpdateReqVO {

    @Schema(description = "序号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "序号不能为空")
    private Integer serialNo;

    @Schema(description = "原行程id", example = "9870")
    private Long originOrderRouteId;

    @Schema(description = "航司代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "航司代码不能为空")
    @Length(max = 8, message = "航司代码长度不能超过8")
    private String airlineNo;

    @Schema(description = "承运航司代码")
    @Length(max = 8, message = "承运航司代码长度不能超过8")
    private String carrierAirlineNo;

    @Schema(description = "航班号（不含航司代码）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "航班号不能为空")
    @Length(max = 16, message = "航班号长度不能超过16")
    private String flightNo;

    @Schema(description = "舱位", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "舱位不能为空")
    @Length(max = 2, message = "舱位长度不能超过2")
    private String cabin;

    @Schema(description = "出发机场三字码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "出发机场三字码不能为空")
    @Length(max = 3, message = "出发机场三字码长度不能超过3")
    private String depart;

    @Schema(description = "抵达机场三字码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "抵达机场三字码不能为空")
    @Length(max = 3, message = "抵达机场三字码长度不能超过3")
    private String arrive;

    @Schema(description = "航班日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "航班日期不能为空")
    private LocalDate flightDate;

    @Schema(description = "抵达日期")
    private LocalDate arriveDate;

    @Schema(description = "出发时间(HH:mm)", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "出发时间不能为空")
    @Length(max = 5, message = "出发时间长度不能超过5")
    private String departTime;

    @Schema(description = "抵达时间(HH:mm:ss)")
    @Length(max = 8, message = "抵达时间长度不能超过8")
    private String arriveTime;

    @Schema(description = "出发航站楼")
    @Length(max = 16, message = "出发航站楼长度不能超过16")
    private String departTerminal;

    @Schema(description = "抵达航站楼")
    @Length(max = 16, message = "抵达航站楼长度不能超过16")
    private String arriveTerminal;

    @Schema(description = "机型")
    @Length(max = 16, message = "机型长度不能超过16")
    private String airModel;

    @Schema(description = "机型名称")
    @Length(max = 16, message = "机型名称长度不能超过16")
    private String airModelName;

    @Schema(description = "行李额")
    @Length(max = 32, message = "行李额长度不能超过32")
    private String baggageWeight;

    @Schema(description = "是否提供餐食", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "是否提供餐食不能为空")
    private Boolean haveFood;

    @Schema(description = "餐食类型", example = "快餐")
    private String foodType;

    @Schema(description = "是否经停", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "是否经停不能为空")
    private Boolean stop;

    @Schema(description = "经停开始日期（经停必填）", requiredMode = Schema.RequiredMode.REQUIRED, example = "2022-01-01")
    @NotNull(message = "经停开始日期不能为空", groups = {AirGroup.Stop.class})
    private LocalDate stopStartDate;

    @Schema(description = "经停结束日期（经停必填）", requiredMode = Schema.RequiredMode.REQUIRED, example = "2022-01-01")
    @NotNull(message = "经停结束日期不能为空", groups = {AirGroup.Stop.class})
    private LocalDate stopEndDate;

    @Schema(description = "经停开始时间（经停必填）", requiredMode = Schema.RequiredMode.REQUIRED, example = "08:00")
    @NotBlank(message = "经停开始时间不能为空", groups = {AirGroup.Stop.class})
    @Length(max = 5, message = "经停航站楼长度不能超过5")
    private String stopStartTime;

    @Schema(description = "经停结束时间（经停必填）", requiredMode = Schema.RequiredMode.REQUIRED, example = "18:00:00")
    @NotBlank(message = "经停结束时间不能为空", groups = {AirGroup.Stop.class})
    @Length(max = 8, message = "经停航站楼长度不能超过8")
    private String stopEndTime;

    @Schema(description = "经停机场三字码（经停必填）", requiredMode = Schema.RequiredMode.REQUIRED, example = "SHA")
    @Length(max = 3, message = "经停机场三字码长度不能超过3")
    @NotBlank(message = "经停机场三字码不能为空", groups = {AirGroup.Stop.class})
    private String stopAirportNo;

    @Schema(description = "经停航站楼", example = "T1")
    @Length(max = 16, message = "经停航站楼长度不能超过16")
    private String stopTerminal;

    @Schema(description = "是否共享航班", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "是否共享航班不能为空")
    private Boolean share;

    @Schema(description = "是否通程航班", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
    @NotNull(message = "是否共享航班不能为空")
    private Boolean through;

    @Schema(description = "准点率")
    private BigDecimal punctualityRate;

    @Schema(description = "飞行距离")
    private Integer distance;

    @Schema(description = "飞行天数", example = "1")
    private Integer flightDays;

    @Schema(description = "飞行时间")
    @Length(max = 16, message = "飞行时间长度不能超过16")
    private String flightTimes;

    @Schema(description = "编码航段状态")
    @Length(max = 8, message = "编码航段状态长度不能超过8")
    private String routeStatus;

    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "创建人")
    private String creator;
}
